<?php
include_once 'dbcofig.php';
// 用户名访问系统时，首先根据session判定用户是否登录
session_start ();
if (isset ( $_SESSION ['username'] )) {
	$a=$_SESSION ['username'];
	$statement = "select * from noteachhour ";
	$pdostatement = $pdo->prepare($statement);
	    $ret = $pdostatement->execute();
	    if($ret){
	    	$data = $pdostatement->fetchAll();
	    }else{
	    	exit("系统错误");
	    }
} else {
	header ( "location:login.php" );
}

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
      <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>管理端非授课量页面</title>
	<!-- BOOTSTRAP STYLES-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FONTAWESOME STYLES-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
     <!-- MORRIS CHART STYLES-->
   
        <!-- CUSTOM STYLES-->
    <link href="assets/css/custom.css" rel="stylesheet" />
     <!-- GOOGLE FONTS-->
   	<link href="assets/css/opensans.css" rel='stylesheet' type='text/css' />
     <!-- TABLE STYLES-->
    <link href="assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="intex.php"><?php echo $a."的信息"?></a> 
            </div>
  <div style="color: white;
padding: 15px 50px 5px 50px;
float: right;	
font-size: 16px;"> 用户名: <?php echo $a;?> &nbsp; <a href="login.php" class="btn btn-danger square-btn-adjust">注销</a> </div>
        </nav>   
           <!-- /. NAV TOP  -->
                <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
				<li class="text-center">
                    <img src="assets/img/find_user.png" class="user-image img-responsive"/>
					</li>
				
					
                   
                      <li  >
                        <a href="table.php"><i class="fa fa-table fa-3x"></i> 授课量统计</a>
                    </li>
                   <li  >
                        <a class="active-menu"  href="form.php"><i class="fa fa-edit fa-3x"></i> 非授课量统计  </a>
                    </li>				
					<li  >
                        <a   href="teacheruser.php"><i class="fa fa-bolt fa-3x"></i> 教师管理</a>
                    </li>	
                          
                   
               
                </ul>
               
            </div>
            
        </nav>  
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper" >
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                     <h2>授课量列表</h2>   
                        <h5>欢迎来到！</h5>
                       
                    </div>
                </div>
                 <!-- /. ROW  -->
                 <hr />
               
            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             表格
                        </div>
                       
                        <div class="panel-body">
                         
                            <div class="table-responsive">
                           
                              <a class='btn btn-primary btn-xs' href="noinsertteachhour.php">添加数据</a>
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                           <th>年度</th>
                                            <th>教工号</th>
                                            <th>非授课内容</th>
                                            <th>奖金</th>
                                            <th>状态</th>
                                            <th> 操作	</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                      
                                        <tr class="even gradeC">
                                        
                                           <?php 
foreach ($data as $row){
 
	

?>
                 <td><?=$row['year']?></td>
              <td><?=$row['teacerId']?></td>
              <td><?=$row['textname']?></td>
              <td><?=$row['menny']?></td>
              <td><?=$row['status']?></td>
              <td><a href="noupdatescore.php?id=<?=$row['id']?>" class='btn btn-primary btn-xs'><i class='fa fa-edit'></i>&nbsp编辑</a>	 
                         <a href="noshanchu.php?id=<?=$row['id']?>" class='btn btn-primary btn-xs'>删除</a>	 
                                              </td>
                                            
                                        </tr>
                                       <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
             		
        </div>
               
    </div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
     <!-- /. WRAPPER  -->
    <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
    <!-- JQUERY SCRIPTS -->
    <script src="assets/js/jquery-1.10.2.js"></script>
      <!-- BOOTSTRAP SCRIPTS -->
    <script src="assets/js/bootstrap.min.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="assets/js/jquery.metisMenu.js"></script>
     <!-- DATATABLES SCRIPTS -->
    <script src="assets/js/dataTables/jquery.dataTables.js"></script>
    <!-- bootstrap SCRIRTS-->
    <script src="assets/js/dataTables/dataTables.bootstrap.js"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
            });
    </script>
         <!-- CUSTOM SCRIPTS -->
    <script src="assets/js/custom.js"></script>
    
   
</body>
</html>
	